﻿using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using Pb;
public class NoticeModel : MonoBehaviour
{
    public GameObject NoticeLabel;
    public GameObject startObj;
    public GameObject targetObj;
    EginUser user = EginUser.Instance;
    //public List<GameRollNoticeItem> NoticePb = new List<GameRollNoticeItem>();
    //public int repeat_times; //0表示一直重复 其他数据表示重复的次数
    //public int interval_seconds;//如果repeat_times需要重复，这里表示间隔秒数
    public UILabel content;


    private void Update()
    {
        //当NoticeLabel大于某一个值得时候销毁     
    }
    private IEnumerator Start()
    {

        bool tempbool = true;
        if (user.NoticePb.Count > 0)
        {
            while (tempbool)
            {

                for (int i = 0; i < user.NoticePb.Count; i++)
                {
                    content.text = user.NoticePb[i].Content;
                    int tempinterval_seconds = 17;
                    NoticeLabel.transform.localPosition = startObj.transform.localPosition;
                    yield return new WaitForSeconds(tempinterval_seconds);

                }
            }
        }
    }
}
